<<<<<<< HEAD
<<<<<<< HEAD
#include <math.h>
void setup() {
  // put your setup code here, to run once:
  pinMode(A0, INPUT);
  Serial.begin(9600);

}

  
void loop() {
  
  // put your main code here, to run repeatedly:
  short int T0 = 10;
  short int a0 = 815;
  short int T1 = 60;
  short int a1 = 397;
  short int a = analogRead(A0);
  
  short int T = convert_adc2temperature(a,a0, a1,T0, T1);
  Serial.println(a);
  Serial.println(T);
  delay(1000);
}


short int convert_adc2temperature(short int ax,short int a0,short int a1,short int temp0, short int temp1)
{ 
  short int tempx;
  tempx = temp0+(ax-a0)*(temp1-temp0)/(a1-a0);
  return tempx - 20;//由于内阻影响经过计算温度误差为20
}
=======
#include <math.h>
void setup() {
  // put your setup code here, to run once:
  pinMode(A0, INPUT);
  Serial.begin(9600);

}

  
void loop() {
  
  // put your main code here, to run repeatedly:
  short int T0 = 10;
  short int a0 = 815;
  short int T1 = 60;
  short int a1 = 397;
  short int a = analogRead(A0);
  
  short int T = convert_adc2temperature(a,a0, a1,T0, T1);
  Serial.println(a);
  Serial.println(T);
  delay(1000);
}


short int convert_adc2temperature(short int ax,short int a0,short int a1,short int temp0, short int temp1)
{ 
  short int tempx;
  tempx = temp0+(ax-a0)*(temp1-temp0)/(a1-a0);
  return tempx - 20;
}
>>>>>>> 0848d32a07c33948f6ee398f6dccfb6d34ad4b34
=======

#include <math.h>
void setup() {
  // put your setup code here, to run once:
  pinMode(A0, INPUT);
  Serial.begin(9600);

}

  
void loop() {
  
  // put your main code here, to run repeatedly:
  short int T0 = 10;
  short int a0 = 815;
  short int T1 = 60;
  short int a1 = 397;
  short int a = analogRead(A0);
  
  short int T = convert_adc2temperature(a,a0, a1,T0, T1);
  Serial.println(a);
  Serial.println(T);
  delay(1000);
}


short int convert_adc2temperature(short int ax,short int a0,short int a1,short int temp0, short int temp1)
{ 
  short int tempx;
  tempx = temp0+(ax-a0)*(temp1-temp0)/(a1-a0);
  return tempx - 20;//由于内阻影响经过计算温度误差为20
}
>>>>>>> 4d5f80cd3772aaa39166e9aeae2cde075cc33687
